<!DOCTYPE html><html><head>
<title>map::slippy::fetcher - Mapping utilities</title>
<style type="text/css"><!--
    HTML {
	background: 	#FFFFFF;
	color: 		black;
    }
    BODY {
	background: 	#FFFFFF;
	color:	 	black;
    }
    DIV.doctools {
	margin-left:	10%;
	margin-right:	10%;
    }
    DIV.doctools H1,DIV.doctools H2 {
	margin-left:	-5%;
    }
    H1, H2, H3, H4 {
	margin-top: 	1em;
	font-family:	sans-serif;
	font-size:	large;
	color:		#005A9C;
	background: 	transparent;
	text-align:		left;
    }
    H1.doctools_title {
	text-align: center;
    }
    UL,OL {
	margin-right: 0em;
	margin-top: 3pt;
	margin-bottom: 3pt;
    }
    UL LI {
	list-style: disc;
    }
    OL LI {
	list-style: decimal;
    }
    DT {
	padding-top: 	1ex;
    }
    UL.doctools_toc,UL.doctools_toc UL, UL.doctools_toc UL UL {
	font:		normal 12pt/14pt sans-serif;
	list-style:	none;
    }
    LI.doctools_section, LI.doctools_subsection {
	list-style: 	none;
	margin-left: 	0em;
	text-indent:	0em;
	padding: 	0em;
    }
    PRE {
	display: 	block;
	font-family:	monospace;
	white-space:	pre;
	margin:		0%;
	padding-top:	0.5ex;
	padding-bottom:	0.5ex;
	padding-left:	1ex;
	padding-right:	1ex;
	width:		100%;
    }
    PRE.doctools_example {
	color: 		black;
	background: 	#f5dcb3;
	border:		1px solid black;
    }
    UL.doctools_requirements LI, UL.doctools_syntax LI {
	list-style: 	none;
	margin-left: 	0em;
	text-indent:	0em;
	padding:	0em;
    }
    DIV.doctools_synopsis {
	color: 		black;
	background: 	#80ffff;
	border:		1px solid black;
	font-family:	serif;
	margin-top: 	1em;
	margin-bottom: 	1em;
    }
    UL.doctools_syntax {
	margin-top: 	1em;
	border-top:	1px solid black;
    }
    UL.doctools_requirements {
	margin-bottom: 	1em;
	border-bottom:	1px solid black;
    }
--></style>
</head>
<!-- Generated from file 'map_slippy_fetcher.man' by tcllib/doctools with format 'html'
   -->
<!-- map::slippy::fetcher.n
   -->
<body><hr> [
   <a href="../../../../../../../../home">Tcllib Home</a>
&#124; <a href="../../../../toc.html">Main Table Of Contents</a>
&#124; <a href="../../../toc.html">Table Of Contents</a>
&#124; <a href="../../../../index.html">Keyword Index</a>
&#124; <a href="../../../../toc0.html">Categories</a>
&#124; <a href="../../../../toc1.html">Modules</a>
&#124; <a href="../../../../toc2.html">Applications</a>
 ] <hr>
<div class="doctools">
<h1 class="doctools_title">map::slippy::fetcher(n) 0.4 tcllib &quot;Mapping utilities&quot;</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>map::slippy::fetcher - Accessing a server providing tiles for slippy-based maps</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li>
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li>
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">API</a>
<ul>
<li class="doctools_subsection"><a href="#subsection1">Methods</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section3">References</a></li>
<li class="doctools_section"><a href="#keywords">Keywords</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="doctools_synopsis">
<ul class="doctools_requirements">
<li>package require <b class="pkgname">Tcl 8.4</b></li>
<li>package require <b class="pkgname">Tk 8.4</b></li>
<li>package require <b class="pkgname">img::png</b></li>
<li>package require <b class="pkgname">map::slippy</b></li>
<li>package require <b class="pkgname">map::slippy::fetcher <span class="opt">?0.4?</span></b></li>
</ul>
<ul class="doctools_syntax">
<li><a href="#1"><b class="cmd">::map::slippy::fetcher</b> <i class="arg">fetcherName</i> <i class="arg">levels</i> <i class="arg">url</i></a></li>
<li><a href="#2"><i class="arg">fetcherName</i> <b class="method">levels</b></a></li>
<li><a href="#3"><i class="arg">fetcherName</i> <b class="method">tileheight</b></a></li>
<li><a href="#4"><i class="arg">fetcherName</i> <b class="method">tilewidth</b></a></li>
<li><a href="#5"><i class="arg">fetcherName</i> <b class="method">get</b> <i class="arg">tile</i> <i class="arg">donecmd</i></a></li>
</ul>
</div>
</div>
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2>
<p>This package provides a class for accessing http servers providing
tiles for slippy-based maps.</p>
</div>
<div id="section2" class="doctools_section"><h2><a name="section2">API</a></h2>
<dl class="doctools_definitions">
<dt><a name="1"><b class="cmd">::map::slippy::fetcher</b> <i class="arg">fetcherName</i> <i class="arg">levels</i> <i class="arg">url</i></a></dt>
<dd><p>Creates the fetcher <i class="arg">fetcherName</i> and configures it with the
number of zoom <i class="arg">levels</i> supported by the tile server, and the
<i class="arg">url</i> it is listening on for tile requests.</p>
<p>The result of the command is <i class="arg">fetcherName</i>.</p></dd>
</dl>
<div id="subsection1" class="doctools_subsection"><h3><a name="subsection1">Methods</a></h3>
<dl class="doctools_definitions">
<dt><a name="2"><i class="arg">fetcherName</i> <b class="method">levels</b></a></dt>
<dd><p>This method returns the number of zoom levels supported by the fetcher
object, and the tile server it is accessing.</p></dd>
<dt><a name="3"><i class="arg">fetcherName</i> <b class="method">tileheight</b></a></dt>
<dd><p>This method returns the height of tiles served, in pixels.</p></dd>
<dt><a name="4"><i class="arg">fetcherName</i> <b class="method">tilewidth</b></a></dt>
<dd><p>This method returns the width of tiles served, in pixels.</p></dd>
<dt><a name="5"><i class="arg">fetcherName</i> <b class="method">get</b> <i class="arg">tile</i> <i class="arg">donecmd</i></a></dt>
<dd><p>This is the main method of the fetcher, retrieving the image for the
specified <i class="arg">tile</i>. The tile identifier is a list containing three
elements, the zoom level, row, and column number of the tile, in this
order.</p>
<p>The command refix <i class="arg">donecmd</i> will be invoked when the fetcher
either knows the image for the tile or that no image will forthcoming.
It will be invoked with either 2 or 3 arguments, i.e.</p>
<ol class="doctools_enumerated">
<li><p>The string <b class="const">set</b>, the <i class="arg">tile</i>, and the image.</p></li>
<li><p>The string <b class="const">unset</b>, and the <i class="arg">tile</i>.</p></li>
</ol>
<p>These two possibilities are used to either signal the image for the
<i class="arg">tile</i>, or that the <i class="arg">tile</i> has no image defined for it.</p></dd>
</dl>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">References</a></h2>
<ol class="doctools_enumerated">
<li><p><a href="http://wiki.openstreetmap.org/wiki/Main_Page">http://wiki.openstreetmap.org/wiki/Main_Page</a></p></li>
</ol>
</div>
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2>
<p><a href="../../../../index.html#http">http</a>, <a href="../../../../index.html#location">location</a>, <a href="../../../../index.html#map">map</a>, <a href="../../../../index.html#server">server</a>, <a href="../../../../index.html#slippy">slippy</a>, <a href="../../../../index.html#tile">tile</a>, <a href="../../../../index.html#url">url</a>, <a href="../../../../index.html#zoom">zoom</a></p>
</div>
</div></body></html>
